package com.vhdadw.service;

import com.vhdadw.contoller.request.ShortLinkAddRequest;
import com.vhdadw.contoller.request.ShortLinkDelRequest;
import com.vhdadw.contoller.request.ShortLinkPageRequest;
import com.vhdadw.contoller.request.ShortLinkUpdateRequest;
import com.vhdadw.model.EventMessage;
import com.vhdadw.utils.JsonData;
import com.vhdadw.vo.ShortLinkVO;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ⼆当家⼩D
 * @since 2025-10-18
 */
public interface ShortLinkService {

    /**
     * 解析短链
     * @param shortLinkCode
     * @return
     */
    ShortLinkVO parseShortLink(String shortLinkCode);

    /**
     * 创建短链
     * @param request
     * @return
     */
    JsonData createShortLink(ShortLinkAddRequest request);

    /**
     * 分页查找短链
     * @param request
     * @return
     */
    Map<String, Object> pageByGroupId(ShortLinkPageRequest request);

    /**
     * 删除短链
     * @param request
     * @return
     */
    JsonData del(ShortLinkDelRequest request);

    /**
     * 更新短链
     * @param request
     * @return
     */
    JsonData update(ShortLinkUpdateRequest request);

    /**
     * 处理新增短链消息
     * @param eventMessage
     * @return
     */
    boolean handleAddShortLink(EventMessage eventMessage);

    /**
     * 处理更新短链消息
     * @param eventMessage
     * @return
     */
    boolean handleUpdateShortLink(EventMessage eventMessage);

    /**
     * 处理删除短链消息
     * @param eventMessage
     * @return
     */
    boolean handleDelShortLink(EventMessage eventMessage);
}
